package com.ieasy.module.system.web.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ieasy.basic.model.Msg;
import com.ieasy.basic.util.cons.Const;
import com.ieasy.module.common.web.action.BaseController;
import com.ieasy.module.system.service.IPositionHistoryService;
import com.ieasy.module.system.web.form.PositionHistoryForm;

@Controller
@RequestMapping("/admin/sys/position_history")
public class PositionHistoryAction extends BaseController {

	@Autowired
	private IPositionHistoryService positionHistoryService ;
	
	@RequestMapping("/position_history_form_UI.do")
	public String quotient_form_UI(PositionHistoryForm form, Model mode){
		if(null != form.getPersonId() && !"".equals(form.getPersonId())) {
			mode.addAttribute("id", form.getId()) ;
			mode.addAttribute("personId", form.getPersonId()) ;
			mode.addAttribute("personName", form.getPersonName()) ;
		}
		return Const.SYSTEM + "position_history_form_UI" ;
	}
	
	
	@RequestMapping("/get.do")
	@ResponseBody
	public PositionHistoryForm get(PositionHistoryForm form){
		return this.positionHistoryService.get(form) ;
	}
	
	@RequestMapping("/add.do")
	@ResponseBody
	public Msg add(PositionHistoryForm form){
		return this.positionHistoryService.add(form) ;
	}
	
	@RequestMapping("/delete.do")
	@ResponseBody
	public Msg delete(PositionHistoryForm form){
		return this.positionHistoryService.delete(form) ;
	}
	
	@RequestMapping("/list.do")
	@ResponseBody
	public List<PositionHistoryForm> list(PositionHistoryForm form){
		return this.positionHistoryService.list(form) ;
	}
	
	
}
